import { createBrowserRouter, Navigate, RouteObject } from 'react-router-dom';

import { LoadElement } from '@/plugins/loadable';

export const routerConfig: RouteObject[] = [
  {
    id: 'editor',
    path: '/editor',
    element: LoadElement({
      load: () => import(/* webpackChunkName:'editor' */ '@/pages/Editor')
    })
  },
  {
    id: '*',
    path: '*',
    element: <Navigate to="/editor" />
  }
];

export const routerStore = createBrowserRouter(routerConfig);
